﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Program05
{
   public  class GradeManage
    {
        //成绩管理类
        public Student stu { get; }

        public Course1 c1 { get; }

        public Course2 c2 { get; }

        public GradeManage() { }

        //总分
        public int Sum { get; }
        //只初始化学生信息的构造方法
        public GradeManage(string stuNo, string stuName, int age)
        {
            stu = new Student()
            {
                No = stuNo,
                Name = stuName,
                Age = age
            };
        }

        //带课程的构造方法
        public GradeManage(string stuNo, string stuName, int age,
            string cName1,int cPeriod1,int cCredit1,int cScore1,
           string cName2, int cPeriod2, int cCredit2, int cScore2)
        {
            stu = new Student()
            {
                No = stuNo,
                Name = stuName,
                Age = age
            };

            c1 = new Course1()
            {
                Name = cName1,
                Period = cPeriod1,
                Credit = cCredit1,
                Score = cScore1
            };

            c2 = new Course2 ()
            {
                Name = cName2,
                Period = cPeriod2,
                Credit = cCredit2,
                Score = cScore2
            };

            Sum = c1.Score + c2.Score;

        }
        //打印方法

        public void Print() => Console.WriteLine($"{stu }{c1 }{c2}总分：{Sum }");

    }
}
